package com.digua.base.socket.request

import org.java_websocket.client.WebSocketClient
import java.nio.ByteBuffer


class ByteBufferRequest : Request<ByteBuffer> {
    private var data: ByteBuffer? = null

    override fun setRequestData(data: ByteBuffer) {
        this.data = data
    }

    override fun getRequestData(): ByteBuffer? = data

    override fun send(client: WebSocketClient?) {
        client?.send(data)
    }

    override fun release() {
        RequestFactory.releaseByteBufferRequest(this)
    }

    override fun toString() = "[@ByteBufferRequest${hashCode()},ByteBuffer:${data?.toString() ?: "null"}]"
}